<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>animation</title>
    <style>
        /*清除浏览器边距*/
        *{padding: 0;margin: 0}
        /*居中*/
        body{
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        @keyframes change-color {
            from {color: red;}
            16% {color: grey;}
            32% {color: yellow;}
            48% { color: green }
            64% { color: black }
            80% { color: blue }
            to /* 100% */ { color: black}  /*最后一帧会丢失*/
        }

        .animate{
            width: 300px;
            height: 100px;
            animation: change-color 14s step-end infinite;
        }
    </style>
</head>
<body>
    <div class="animate">动画测试<div>
</body>
</html>